<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  	<head>
        <title>P2P Fusion - Peerscape</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <meta name="generator" content="Peerscape" />
        <meta http-equiv="imagetoolbar" content="no" />

        <style type="text/css">
            <!-- 
            @import url(/static/css/core.css);
            @import url(/static/css/content.css);
            -->
        </style>
        <link rel="shortcut icon" type="image/x-icon" href="http://p2p-fusion.org/favicon.ico" />
    </head>
  	<body class="person">
	    <div id="wrapper">
	        <div id="inner">
                <div id="topLinks">
                    <h5 class="hide">Personal tools</h5>
                    <ul>
                        <li>
                            <a id="admin" href="http://admin.hexlabel.net/">My Admin</a>
                        </li>
                        <li>
                            <a id="user" href="http://my.hexlabel.net/">My Profile</a>
                        </li>
                    </ul>
                    <div class="clr"><br/></div>
                </div>

                <div id="main">
                    <div class="inner">
                        <div id="header">
                            <div class="left">
                                <h1 id="logo"><a href="http://my.hexlabel.net/" accesskey="1">fusion</a></h1>
                                <h2 id="subtitle">Peerscape</h2>
                            </div>
                            <div class="right">
                                <div id="notifications">
                                    <div class="inner">
                                        % if is_empty and is_self:
                                            <div class="item">
                                                <p>Your profile is empty</p>
                                                <p><a href="/person/edit">Click here to edit your profile</a></p>
                                            </div>
                                        % endif

                                        % if len(invitations) > 0 and is_self:
                                            <div class="item">
                                                <p>You have ${len(invitations)} pending invitation(s)</p>
                                                <p><a href="http://admin.hexlabel.net/invitations/#pending">Click here to view</a></p>
                                            </div>
                                        % endif

                                        % if invitations.has_key(hexlabel):
                                            <div class="item">
                                                <p>You have a pending friendship invitation from this person.</p>
                                                <form method="POST" action="http://admin.hexlabel.net/invitations/" class="listForm">
                                                    <input type="hidden" name="do" value="decide"/>
                                                    <input type="hidden" name="invitation_iid" value="${hexlabel}"/>
                                                    <dl>
                                                        <dd class="buttons">
                                                            <input type="submit" class="submit" name="decision" value="Decline"/>
                                                            <input type="submit" class="submit default" name="decision" value="Accept"/>
                                                        </dd>
                                                    </dl>
                                                    <div class="clr"><br/></div>
                                                </form>
                                            </div>
                                        % endif

                                        % if not is_friend and not is_self:
                                            <div class="item">
                                                <p>You are not friends with this person</p>
                                                <form method="POST" action="http://admin.hexlabel.net/invite_person/" class="listForm">
                                                    <input type="hidden" name="iid" value="${hexlabel}"/>
                                                    <input type="hidden" name="email" value="${profile_fields['contact']['email']['values'][0]['value']}"/>
                                                    <dl>
                                                        <dd class="buttons">
                                                            <input type="submit" class="submit" value="Invite"/>
                                                        </dd>
                                                    </dl>
                                                    <div class="clr"><br/></div>
                                                </form>
                                            </div>
                                        % endif
                                    </div>
                                </div>
                                <div id="globalTools">
                                    <h5 class="hide">Global tools</h5>
                                        % if is_self:
                                            <ul class="contextTools">
                                                <li><a href="/person/edit/">Edit profile</a></li>
                                                <li><a href="/person/edit_picture/">Edit picture</a></li>
                                            </ul>
                                            <!--
                                            <ul class="extTools">
                                                <li><a href="http://admin.hexlabel.net/invite_person/">Invite a friend</a></li>
                                                <li><a href="http://admin.hexlabel.net/invitations/">Invitations</a></li>
                                            </ul>
                                            -->
                                        % endif
                                </div>
                            </div>
                            <div class="clr"><br/></div>
                        </div>

                        <div id="content">
                            <div id="pic">
                                <img src="${profile_fields['generic']['picture']['values'][0]['value']}" alt="Profile picture"/>
                            </div>
                            <div id="info">
                                <h2>
                                    ${profile_fields['generic']['name']['values'][0]['value']}
                                    <span class="inlineNav">
                                        <a href="#friends">Friends</a>
                                        <a href="#groups">Groups</a>
                                        <a href="#mycontent">Content</a>
                                    </span>
                                </h2>
                                % if profile_fields['generic']['about']['values'][0]['value']:
                                    <p>"${profile_fields['generic']['about']['values'][0]['value']}"</p>
                                % endif
                                <dl class="personal">
                                    % if is_self or profile_fields['personal']['born']['values'][0]['visibility']:
                                    <dt>${profile_fields['personal']['born']['meta']['label']}</dt>
                                    <dd>
                                        ${profile_fields['personal']['born']['values'][0]['value']}
                                    </dd>
                                    % endif

                                    % if is_self or profile_fields['personal']['gender']['values'][0]['visibility']:
                                    <dt>${profile_fields['personal']['gender']['meta']['label']}</dt>
                                    <dd>
                                        ${profile_fields['personal']['gender']['values'][0]['value']}
                                    </dd>
                                    % endif
                                    % if not is_self and profile_fields['personal']['meta']['num_visible'] == 0:
                                        <dd>No personal information available.</dd>
                                    % endif
                                </dl>
                                <dl class="location">
                                    % if is_self or profile_fields['location']['country']['values'][0]['visibility']:
                                    <dt>${profile_fields['location']['country']['meta']['label']}</dt>
                                    <dd>
                                        ${profile_fields['location']['country']['values'][0]['value']}
                                    </dd>
                                    % endif

                                    % if is_self or profile_fields['location']['region']['values'][0]['visibility']:
                                    <dt>${profile_fields['location']['region']['meta']['label']}</dt>
                                    <dd>
                                        ${profile_fields['location']['region']['values'][0]['value']}
                                    </dd>
                                    % endif

                                    % if is_self or profile_fields['location']['city']['values'][0]['visibility']:
                                    <dt>${profile_fields['location']['city']['meta']['label']}</dt>
                                    <dd>
                                        ${profile_fields['location']['city']['values'][0]['value']}
                                    </dd>
                                    %endif

                                    % if not is_self and profile_fields['location']['meta']['num_visible'] == 0:
                                        <dd>No location information available.</dd>
                                    % endif
                                </dl>
                                <dl class="contact">
                                    % if is_self or profile_fields['contact']['email']['values'][0]['visibility']:
                                    <dt>${profile_fields['contact']['email']['meta']['label']}</dt>
                                    <dd>
                                        <a href="mailto:${profile_fields['contact']['email']['values'][0]['value']}">${profile_fields['contact']['email']['values'][0]['value']}</a>
                                    </dd>
                                    % endif

                                    % if is_self or profile_fields['contact']['website']['values'][0]['visibility']:
                                    <dt>${profile_fields['contact']['website']['meta']['label']}</dt>
                                    <dd>
                                        <a href="${profile_fields['contact']['website']['values'][0]['value']}">${profile_fields['contact']['website']['values'][0]['value']}</a>
                                    </dd>
                                    % endif

                                    % if is_self or profile_fields['contact']['phone']['values'][0]['visibility']:
                                    <dt>${profile_fields['contact']['phone']['meta']['label']}</dt>
                                    <dd>
                                        ${profile_fields['contact']['phone']['values'][0]['value']}
                                    </dd>
                                    % endif

                                    % if is_self or profile_fields['contact']['im']['values'][0]['visibility']:
                                    <dt>${profile_fields['contact']['im']['meta']['label']}</dt>
                                    <dd>
                                        ${profile_fields['contact']['im']['values'][0]['value']}
                                    </dd>
                                    % endif

                                    % if not is_self and profile_fields['contact']['meta']['num_visible'] == 0:
                                        <dd>No contact information available.</dd>
                                    % endif
                                </dl>
                                <div class="clr"><br/></div>
                            </div>

                            <!--
                            <div class="section" id="updates">
                                <h3>
                                    Updates
                                    <span class="inlineNav">
                                        <a href="#wrapper">^ Top</a>
                                    </span>
                                </h3>
                                % if profile_fields.get('updates'):
                                    <p>UPDATES</p>
                                % else:
                                    <p>Nothing new.</p>
                                % endif

                            </div>
                            -->

                            <div class="section" id="friends">
                                <h3>
                                    Friends (${len(friend_list['index'])})
                                    <span class="inlineNav">
                                        % if is_self:
                                            <a href="http://admin.hexlabel.net/invitations/#friends">Manage</a>
                                        % endif
                                        <a href="#wrapper">^ Top</a>
                                    </span>
                                </h3>
                                % if is_self:
                                <div class="left">
                                % endif
                                    % if len(friend_list['index']) > 0:
                                        <ul>
                                            % for iid in friend_list['index']:
                                                % if friend_list['items'][iid]['is_self']:
                                                <li class="self">
                                                % elif friend_list['items'][iid]['is_mutual']:
                                                <li class="mutual">
                                                % else:
                                                <li>
                                                % endif
                                                    <a href="http://${iid}.hexlabel.net/">
                                                        <img src="${friend_list['items'][iid]['picture']}" alt="${friend_list['items'][iid]['name']}" class="thumbnail"/>
                                                    </a>
                                                    <a href="http://${iid}.hexlabel.net/">
                                                        ${friend_list['items'][iid]['name']}
                                                    </a>
                                                    <div class="roles">
                                                        % if friend_list['items'][iid]['is_self']:
                                                            <div class="role"><span class="self">YOU</span></div>
                                                        % endif
                                                        % if friend_list['items'][iid]['is_mutual']:
                                                            <div class="role"><span class="mutual">Friend</span></div>
                                                        % endif
                                                    </div>
                                                </li>
                                            
                                            % endfor
                                        </ul>
                                    % else:
                                        <ul>
                                            <li>No friends</li>
                                        </ul>
                                    % endif
                                % if is_self:
                                </div>
                                % endif
                                % if is_self:
                                    <div class="right">
                                        <ul>
                                            <li>
                                                <form id="inviationForm" class="inline" action="http://admin.hexlabel.net/invitations/" method="GET">
                                                    <input type="hidden" name="do" value="entercode"/>
                                                    <label for="invitecode">Enter invitation code here:</label><br/>
                                                    <input type="text" class="text" id="invitecode" name="invitecode"/>
                                                    <input type="submit" class="submit nowrap" value="Go"/>
                                                </form>
                                            </li>
                                            <li><a href="http://admin.hexlabel.net/invite_person/">Click here to invite a friend</a></li>
                                            <li><a href="http://admin.hexlabel.net/invitations/">View invitations (${len(invitations)} pending)</a></li>
                                        </ul>
                                    </div>
                                % endif
                                <div class="clr"><br/></div>
                            </div>

                            <div class="section" id="groups">
                                <h3>
                                    Groups (${len(group_list['index'])})
                                    <span class="inlineNav">
                                        % if is_self:
                                            <a href="http://admin.hexlabel.net/invitations/#groups">Manage</a>
                                        % endif
                                        <a href="#wrapper">^ Top</a>
                                    </span>
                                </h3>
                                % if len(group_list['index']) > 0:
                                    <ul>
                                        % for iid in group_list['index']:
                                            % if group_list['items'][iid]['is_mutual']:
                                            <li class="mutual">
                                            % else:
                                            <li>
                                            % endif
                                                <a href="http://${iid}.hexlabel.net/">
                                                    <img src="${group_list['items'][iid]['picture']}" alt="${group_list['items'][iid]['name']}" class="thumbnail"/>
                                                </a>
                                                <a href="http://${iid}.hexlabel.net/">${group_list['items'][iid]['name']}</a>
                                                <div class="roles">
                                                    % if group_list['items'][iid]['is_mutual']:
                                                        <div class="role"><span class="mutual">Member</span></div>
                                                    % endif
                                                </div>
                                            </li>
                                        % endfor
                                    </ul>
                                % else:
                                    <ul>
                                        <li>No groups.</li>
                                    </ul>
                                % endif

                            </div>

                            <div class="section" id="mycontent">
                                <h3>
                                    Content
                                    <span class="inlineNav">
                                        % if is_self:
                                            <a href="#">Manage</a>
                                        % endif
                                        <a href="#wrapper">^ Top</a>
                                    </span>
                                </h3>
                                % if content:
                                    <p>CONTENT</p>
                                % else:
                                    <ul>
                                        <li>No content.</li>
                                    </ul>
                                % endif
                            </div>
                        </div>
                    </div>
                </div>
    
                <div id="footer">
                    <div class="left">
                        <ul>
                            <li><a class="footer" href="http://p2p-fusion.org">Home</a></li>
                            <li><a class="footer" href="http://p2p-fusion.org/contact">Contact us</a></li>
                            <li><a class="footer" href="http://p2p-fusion.org/disclaimer">Disclaimer</a></li>
                        </ul>
                    </div>
                    <div class="right">
                        <p class="footerText">P2P-FUSION is co-funded by the European Union through the IST programme under FP6.</p>
                    </div>
                    <div class="clr"><br/></div>
                </div>
            </div>
	    </div>
	</body>
</html>


